//
//  Button_imageView.m
//  03-HomeWork
//
//  Created by dllo on 16/7/18.
//  Copyright © 2016年 danming. All rights reserved.
//

#import "Button_imageView.h"

@implementation Button_imageView
- (instancetype)initWithFrame:(CGRect)frame image:(UIImage *)image target:(id)target action:(SEL)action {
    self = [super initWithFrame:frame];
    if (self) {
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:target action:action];
        [self createImageWithFrame:frame image:image];
        [_imageView addGestureRecognizer:tap];
    }
    return self;
}
- (void)createImageWithFrame:(CGRect)frame image:(UIImage *)image {
    self.imageView = [[UIImageView alloc] initWithFrame:self.bounds];
    _imageView.image = image;
    _imageView.userInteractionEnabled = YES;
    [self addSubview:_imageView];
}


@end
